package com.fiberhome.platform.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fiberhome.platform.common.PageResult;
import com.fiberhome.platform.mapper.DesignNeedMapper;
import com.fiberhome.platform.service.ReaderService;

@Controller
public class ExcelController {
	@Autowired
	private ReaderService readerService;
	@Autowired
	private DesignNeedMapper designNeedMapper;
	@RequestMapping("/reader")
	@ResponseBody
	public PageResult read() {
		PageResult need = readerService.readNeedExcel("C:\\need.xls");
		PageResult test = readerService.readTestExcel("C:\\test.xls");
		if (need.getStatus()==500 || test.getStatus()==500) {
			return PageResult.build(500, "读取失败！");
		}
		return test;
	}
	
}
